<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@page import="bean.dal.*,bean.entity.*"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<%
		String msg = (String) session.getAttribute("msg");
		session.setAttribute("msg","");
		CreditManager creditM = new CreditManager();
		int id = Integer.parseInt(request.getParameter("id"));
		Credit credit = creditM.getCreditById(id); 
	%>
	<jsp:include page="top.jsp"></jsp:include>
    <form id="bigBox" method="POST" action="/express/servlet/Creditex?modth=update&id=<%=id %>" name="update" onsubmit="return check()">
        <h1>修改积分券</h1>
        <font color="red">
            <span id="message">
                <%if(msg==null){msg="";} %>
                    <%=msg %>
            </span>
        </font>
        <!-- 修改积分券类型容器 -->
        <div class="inputBox">
            <!-- 积分券名称 -->
            <div class="inputText">
                <span>
                    <i class="iconfont icon-user"></i>
                    名称:
                </span>
                <input type="text" id="creditname" name="creditname" value="<%=credit.getCreditname() %>">
            </div>
            <!-- 积分券详情 -->
            <div class="inputText">
                <span>
                    <i class="iconfont icon-xiangqing"></i>
                    介绍:
                </span>
                <textarea id="introduce" name="introduce" ><%=credit.getIntroduce() %></textarea>
            </div>
            <!-- 积分券对应价值 -->
            <div class="inputText">
                <span>
                    <i class="iconfont icon-xiangqing"></i>
                   价格:
                </span>
                <textarea id="introduce" name="price" ><%=credit.getPrice() %></textarea>
            </div>
            <!-- 兑换所需积分 -->
            <div class="inputText">
                <span>
                    <i class="iconfont icon-jifen"></i>
                    积分:
                </span>
                <input type="text" id="credit" name="credit" value="<%=credit.getCredit() %>">
            </div>
            <!-- 上架数量 -->
            <div class="inputText">
                <span>
                    <i class="iconfont icon-type"></i>
                    数量:
                </span>
                <input type="text" id="quantity" name="quantity" value="<%=credit.getQuantity() %>">
            </div>
            <!-- 保存按钮 -->
            <input type="submit" class="inputButton" value="保存">
            <!-- 返回按钮 -->
            <a href="admin/creditex.jsp">
                <input type="button" class="inputButton" value="返回">
            </a>
        </div>
    </form>
</body>

</html>
